﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HotelManageSystem.Domain;
using HotelManageSystem.Domain.Entities;
using HotelManageSystem.Domain.Infrastructure;

namespace HotelManageSystem.DAL.Repositories
{
    public class RoomRepository:Repository<Room>,IRoomRepository
    {
        public RoomRepository(IDatabaseFactory databaseFactory):base(databaseFactory)
        {

        }

        public int GetRoomNumberByState(int id)
        {
            var rooms = DataContext.Rooms.Where(x => x.RoomState.ID == id).ToList();
            return rooms.Count();
        }


        public List<Room> GetRoomByState(int id)
        {
            var rooms = DataContext.Rooms.Where(x => x.RoomState.ID == id).ToList();
            return rooms;
        }
    }
}
